package jco3.JCoDestination.demo1;

import org.junit.Test;

import com.sap.conn.jco.JCoDestination;
import com.sap.conn.jco.JCoDestinationManager;
import com.sap.conn.jco.JCoException;
/**
 * 
 * @author zhuangjun
 * 配置文件获取SAP链接对象，ECC.jcodestination要放在项目根目录下
 */
public class JCoDestinationDemo {
	
	public JCoDestination getDestination() throws JCoException{
		 /**
         * Get instance of JCoDestination from file: ECC.jcodestination
         * which should be located in the installation folder of project
         */
		JCoDestination dest = JCoDestinationManager.getDestination("ECC");
		return dest;
	}
	
	@Test
	public void pingDestination() throws JCoException{
		JCoDestination dest = this.getDestination();
		dest.ping();
	}
}
